#include<bits/stdc++.h>
using namespace std;

int main() {
	int x, y;
	cin >> x >> y;
	if(x == y) {
		cout << 1 << endl;
		return 0;
	} 
	if((x + y) % 2 == 0) {
		cout << 3 << endl;
	} else {
		cout << 2 << endl;
	}
	return 0;
}

